namespace DotNetNuke.NavigationControl
{
    using DotNetNuke.Modules.NavigationProvider;
    using DotNetNuke.UI.WebControls;
    
    using Solpart.WebControls;
    using System;
    using System.Collections;
    using System.Drawing;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Xml;
    using VB2CS;

    public class SolpartMenuNavigationProvider : DotNetNuke.Modules.NavigationProvider.NavigationProvider
    {
        private bool m_blnIndicateChildren;
        private SolpartMenu m_objMenu;
        private string m_strControlID;
        private string m_strCSSBreadCrumbRoot;
        private string m_strCSSBreadCrumbSub;
        private string m_strCSSLeftSeparator;
        private string m_strCSSLeftSeparatorBreadCrumb;
        private string m_strCSSLeftSeparatorSelection;
        private string m_strCSSNodeHoverRoot;
        private string m_strCSSNodeHoverSub;
        private string m_strCSSNodeRoot;
        private string m_strCSSRightSeparator;
        private string m_strCSSRightSeparatorBreadCrumb;
        private string m_strCSSRightSeparatorSelection;
        private string m_strCSSSeparator;
        private string m_strIndicateChildImageBreadCrumbRoot;
        private string m_strIndicateChildImageBreadCrumbSub;
        private string m_strNodeLeftHTMLBreadCrumbRoot = "";
        private string m_strNodeLeftHTMLBreadCrumbSub = "";
        private string m_strNodeLeftHTMLRoot = "";
        private string m_strNodeLeftHTMLSub = "";
        private string m_strNodeRightHTMLBreadCrumbRoot = "";
        private string m_strNodeRightHTMLBreadCrumbSub = "";
        private string m_strNodeRightHTMLRoot = "";
        private string m_strNodeRightHTMLSub = "";
        private string m_strNodeSelectedRoot;
        private string m_strNodeSelectedSub;
        private string m_strSeparatorHTML = "";
        private string m_strSeparatorLeftHTML = "";
        private string m_strSeparatorLeftHTMLActive = "";
        private string m_strSeparatorLeftHTMLBreadCrumb = "";
        private string m_strSeparatorRightHTML = "";
        private string m_strSeparatorRightHTMLActive = "";
        private string m_strSeparatorRightHTMLBreadCrumb = "";
        private string m_strStyleRoot;

        private void AddSeparator(string strType, DNNNode objPrevNode, DNNNode objNextNode)
        {
            string strLeftHTML = this.SeparatorLeftHTML + this.SeparatorLeftHTMLBreadCrumb + this.SeparatorLeftHTMLActive;
            string strRightHTML = this.SeparatorRightHTML + this.SeparatorRightHTMLBreadCrumb + this.SeparatorRightHTMLActive;
            if ((this.SeparatorHTML + strLeftHTML + strRightHTML).Length > 0)
            {
                string strSeparatorTable = "";
                string strSeparator = "";
                string strSeparatorLeftHTML = "";
                string strSeparatorRightHTML = "";
                string strSeparatorClass = "";
                string strLeftSeparatorClass = "";
                string strRightSeparatorClass = "";
                if (strLeftHTML.Length > 0)
                {
                    strLeftSeparatorClass = this.GetSeparatorText(this.CSSLeftSeparator, this.CSSLeftSeparatorBreadCrumb, this.CSSLeftSeparatorSelection, objNextNode);
                    strSeparatorLeftHTML = this.GetSeparatorText(this.SeparatorLeftHTML, this.SeparatorLeftHTMLBreadCrumb, this.SeparatorLeftHTMLActive, objNextNode);
                }
                if (this.SeparatorHTML != "")
                {
                    if (this.CSSSeparator != "")
                    {
                        strSeparatorClass = this.CSSSeparator;
                    }
                    strSeparator = this.SeparatorHTML;
                }
                if (strRightHTML.Length > 0)
                {
                    strRightSeparatorClass = this.GetSeparatorText(this.CSSRightSeparator, this.CSSRightSeparatorBreadCrumb, this.CSSRightSeparatorSelection, objPrevNode);
                    strSeparatorRightHTML = this.GetSeparatorText(this.SeparatorRightHTML, this.SeparatorRightHTMLBreadCrumb, this.SeparatorRightHTMLActive, objPrevNode);
                }
                strSeparatorTable = "<table summary=\"Table for menu separator design\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr>";
                if ((((strSeparatorRightHTML != "") && (strType != "Left")) ? 1 : 0) != 0)
                {
                    strSeparatorTable = strSeparatorTable + this.GetSeparatorTD(strRightSeparatorClass, strSeparatorRightHTML);
                }
                if (((((strSeparator != "") && (strType != "Left")) && (strType != "Right")) ? 1 : 0) != 0)
                {
                    strSeparatorTable = strSeparatorTable + this.GetSeparatorTD(strSeparatorClass, strSeparator);
                }
                if ((((strSeparatorLeftHTML != "") && (strType != "Right")) ? 1 : 0) != 0)
                {
                    strSeparatorTable = strSeparatorTable + this.GetSeparatorTD(strLeftSeparatorClass, strSeparatorLeftHTML);
                }
                strSeparatorTable = strSeparatorTable + "</tr></table>";
                XmlNode objBreak = this.Menu.AddBreak("", strSeparatorTable);
            }
        }

        public override void Bind(DNNNodeCollection objNodes)
        {
            SPMenuItemNode objMenuItem = null;
            DNNNode objNode = null;
            DNNNode objPrevNode = null;
            IEnumerator refObjectHelperL0=null;
            bool RootFlag=false;
            if (this.IndicateChildren && (this.IndicateChildImageRoot.Length > 0))
            {
                this.Menu.RootArrow = true;
            }
            try
            {
                refObjectHelperL0 = objNodes.GetEnumerator();
                while (refObjectHelperL0.MoveNext())
                {
                    objNode = (DNNNode) refObjectHelperL0.Current;
                    try
                    {
                        if (objNode.Level == 0)
                        {
                            if (RootFlag)
                            {
                                this.AddSeparator("All", objPrevNode, objNode);
                            }
                            else
                            {
                                if ((this.SeparatorLeftHTML == "") && (this.SeparatorLeftHTMLBreadCrumb == ""))
                                {
                                }
                                if (((this.SeparatorLeftHTMLActive != "") ? 1 : 0) != 0)
                                {
                                    this.AddSeparator("Left", objPrevNode, objNode);
                                }
                                RootFlag = true;
                            }
                            if (!objNode.Enabled)
                            {
                                objMenuItem = new SPMenuItemNode(this.Menu.AddMenuItem(objNode.ID.ToString(), objNode.Text, ""));
                            }
                            else if (!String.IsNullOrEmpty(objNode.JSFunction))
                            {
                                objMenuItem = new SPMenuItemNode(this.Menu.AddMenuItem(objNode.ID.ToString(), objNode.Text, this.GetClientScriptURL(objNode.JSFunction, objNode.ID)));
                            }
                            else
                            {
                                objMenuItem = new SPMenuItemNode(this.Menu.AddMenuItem(objNode.ID.ToString(), objNode.Text, objNode.NavigateURL));
                            }
                            if (!String.IsNullOrEmpty(this.StyleRoot))
                            {
                                objMenuItem.ItemStyle = this.StyleRoot;
                            }
                            if (this.CSSNodeRoot != "")
                            {
                                objMenuItem.ItemCss = this.CSSNodeRoot;
                            }
                            if (this.CSSNodeHoverRoot != "")
                            {
                                objMenuItem.ItemSelectedCss = this.CSSNodeHoverRoot;
                            }
                            if (this.NodeLeftHTMLRoot != "")
                            {
                                objMenuItem.LeftHTML = this.NodeLeftHTMLRoot;
                            }
                            if (objNode.BreadCrumb)
                            {
                                objMenuItem.ItemCss = this.CSSBreadCrumbRoot;
                                if (this.NodeLeftHTMLBreadCrumbRoot != "")
                                {
                                    objMenuItem.LeftHTML = this.NodeLeftHTMLBreadCrumbRoot;
                                }
                                if (this.NodeRightHTMLBreadCrumbRoot != "")
                                {
                                    objMenuItem.RightHTML = this.NodeRightHTMLBreadCrumbRoot;
                                }
                                if (objNode.Selected)
                                {
                                    objMenuItem.ItemCss = this.CSSNodeSelectedRoot;
                                }
                            }
                            if (this.NodeRightHTMLRoot != "")
                            {
                                objMenuItem.RightHTML = this.NodeRightHTMLRoot;
                            }
                        }
                        else if (objNode.IsBreak)
                        {
                            this.Menu.AddBreak(objNode.ParentNode.ID.ToString());
                        }
                        else
                        {
                            try
                            {
                                if (!objNode.Enabled)
                                {
                                    objMenuItem = new SPMenuItemNode(this.Menu.AddMenuItem(objNode.ParentNode.ID.ToString(), objNode.ID.ToString(), "&nbsp;" + objNode.Text, ""));
                                }
                                else if (!String.IsNullOrEmpty(objNode.JSFunction))
                                {
                                    objMenuItem = new SPMenuItemNode(this.Menu.AddMenuItem(objNode.ParentNode.ID.ToString(), objNode.ID.ToString(), "&nbsp;" + objNode.Text, this.GetClientScriptURL(objNode.JSFunction, objNode.ID)));
                                }
                                else
                                {
                                    objMenuItem = new SPMenuItemNode(this.Menu.AddMenuItem(objNode.ParentNode.ID.ToString(), objNode.ID.ToString(), "&nbsp;" + objNode.Text, objNode.NavigateURL));
                                }
                                if (objNode.ClickAction == eClickAction.PostBack)
                                {
                                    objMenuItem.RunAtServer = true;
                                }
                                if (this.CSSNodeHoverSub != "")
                                {
                                    objMenuItem.ItemSelectedCss = this.CSSNodeHoverSub;
                                }
                                if (this.NodeLeftHTMLSub != "")
                                {
                                    objMenuItem.LeftHTML = this.NodeLeftHTMLSub;
                                }
                                if (objNode.BreadCrumb)
                                {
                                    objMenuItem.ItemCss = this.CSSBreadCrumbSub;
                                    if (this.NodeLeftHTMLBreadCrumbSub != "")
                                    {
                                        objMenuItem.LeftHTML = this.NodeLeftHTMLBreadCrumbSub;
                                    }
                                    if (this.NodeRightHTMLBreadCrumbSub != "")
                                    {
                                        objMenuItem.RightHTML = this.NodeRightHTMLBreadCrumbSub;
                                    }
                                    if (objNode.Selected)
                                    {
                                        objMenuItem.ItemCss = this.CSSNodeSelectedSub;
                                    }
                                }
                                if (this.NodeRightHTMLSub != "")
                                {
                                    objMenuItem.RightHTML = this.NodeRightHTMLSub;
                                }
                            }
                            catch //(Exception exception1)
                            {
                
                                objMenuItem = null;
                
                            }
                        }
                        if (!String.IsNullOrEmpty(objNode.Image))
                        {
                            if (objNode.Image.IndexOf("/") > -1)
                            {
                                string strImage = objNode.Image;
                                if (strImage.StartsWith(this.Menu.IconImagesPath))
                                {
                                    strImage = strImage.Substring(this.Menu.IconImagesPath.Length);
                                }
                                if (strImage.IndexOf("/") > -1)
                                {
                                    objMenuItem.Image = strImage.Substring(strImage.LastIndexOf("/") + 1);
                                    if (strImage.StartsWith("/"))
                                    {
                                        objMenuItem.ImagePath = strImage.Substring(0, strImage.LastIndexOf("/") + 1);
                                    }
                                    else
                                    {
                                        objMenuItem.ImagePath = this.Menu.IconImagesPath + strImage.Substring(0, strImage.LastIndexOf("/") + 1);
                                    }
                                }
                                else
                                {
                                    objMenuItem.Image = strImage;
                                }
                            }
                            else
                            {
                                objMenuItem.Image = objNode.Image;
                            }
                        }
                        objMenuItem.ToolTip = objNode.ToolTip;
                        this.Bind(objNode.DNNNodes);
                    }
                    catch (Exception exception2)
                    {
                        
                        Exception ex = exception2;
                        throw ex;
        
                    }
                    objPrevNode = objNode;
                }
            }
            finally
            {
                if (refObjectHelperL0 is IDisposable)
                {
                    (refObjectHelperL0 as IDisposable).Dispose();
                }
            }
            if ((((objNode != null) && (objNode.Level == 0)) ? 1 : 0) != 0)
            {
                if ((this.SeparatorRightHTML == "") && (this.SeparatorRightHTMLBreadCrumb == ""))
                {
                }
                if (((this.SeparatorRightHTMLActive != "") ? 1 : 0) != 0)
                {
                    this.AddSeparator("Right", objPrevNode, null);
                }
            }
        }

        private void ctlActions_MenuClick(string ID)
        {
            this.RaiseEvent_NodeClick(ID);
        }

        private string GetClientScriptURL(string strScript, string strID)
        {
            if (!strScript.ToLower().StartsWith("javascript:"))
            {
                strScript = "javascript: " + strScript;
            }
            return strScript;
        }

        private string GetSeparatorTD(string strClass, string strHTML)
        {
            string strRet = "";
            if (strClass != "")
            {
                strRet = strRet + "<td class = \"" + strClass + "\">";
            }
            else
            {
                strRet = strRet + "<td>";
            }
            return (strRet + strHTML + "</td>");
        }

        private string GetSeparatorText(string strNormal, string strBreadCrumb, string strSelection, DNNNode objNode)
        {
            string strRet = "";
            if (strNormal != "")
            {
                strRet = strNormal;
            }
            if (((((strBreadCrumb != "") && (objNode != null)) && objNode.BreadCrumb) ? 1 : 0) != 0)
            {
                strRet = strBreadCrumb;
            }
            if (((((strSelection != "") && (objNode != null)) && objNode.Selected) ? 1 : 0) != 0)
            {
                strRet = strSelection;
            }
            return strRet;
        }

        public override void Initialize()
        {
            this.m_objMenu = new SolpartMenu();
            this.Menu.ID = this.m_strControlID;
            this.Menu.SeparateCSS = true;
            this.m_objMenu.MenuClick += new SolpartMenu.MenuClickEventHandler(this.ctlActions_MenuClick);
        }

        public override DotNetNuke.Modules.NavigationProvider.NavigationProvider.Alignment ControlAlignment
        {
            get
            {
                DotNetNuke.Modules.NavigationProvider.NavigationProvider.Alignment ControlAlignment=NavigationProvider.Alignment.Center;
                switch (this.Menu.MenuAlignment.ToLower())
                {
                    case "left":
                        return DotNetNuke.Modules.NavigationProvider.NavigationProvider.Alignment.Left;

                    case "right":
                        return DotNetNuke.Modules.NavigationProvider.NavigationProvider.Alignment.Right;

                    case "center":
                        return DotNetNuke.Modules.NavigationProvider.NavigationProvider.Alignment.Center;

                    case "justify":
                        ControlAlignment = DotNetNuke.Modules.NavigationProvider.NavigationProvider.Alignment.Justify;
                        break;
                }
                return ControlAlignment;
            }
            set
            {
                switch (((int) value))
                {
                    case 0:
                        this.Menu.MenuAlignment = "Left";
                        break;

                    case 1:
                        this.Menu.MenuAlignment = "Right";
                        break;

                    case 2:
                        this.Menu.MenuAlignment = "Center";
                        break;

                    case 3:
                        this.Menu.MenuAlignment = "Justify";
                        break;
                }
            }
        }

        public override string ControlID
        {
            get
            {
                return this.m_strControlID;
            }
            set
            {
                this.m_strControlID = value;
            }
        }

        public override DotNetNuke.Modules.NavigationProvider.NavigationProvider.Orientation ControlOrientation
        {
            get
            {
                DotNetNuke.Modules.NavigationProvider.NavigationProvider.Orientation ControlOrientation=NavigationProvider.Orientation.Horizontal;
                switch (this.Menu.Display.ToLower())
                {
                    case "horizontal":
                        return DotNetNuke.Modules.NavigationProvider.NavigationProvider.Orientation.Horizontal;

                    case "vertical":
                        ControlOrientation = DotNetNuke.Modules.NavigationProvider.NavigationProvider.Orientation.Vertical;
                        break;
                }
                return ControlOrientation;
            }
            set
            {
                switch (((int) value))
                {
                    case 0:
                        this.Menu.Display = "Horizontal";
                        break;

                    case 1:
                        this.Menu.Display = "Vertical";
                        break;
                }
            }
        }

        public override string CSSBreadCrumbRoot
        {
            get
            {
                return this.m_strCSSBreadCrumbRoot;
            }
            set
            {
                this.m_strCSSBreadCrumbRoot = value;
            }
        }

        public override string CSSBreadCrumbSub
        {
            get
            {
                return this.m_strCSSBreadCrumbSub;
            }
            set
            {
                this.m_strCSSBreadCrumbSub = value;
            }
        }

        public override string CSSBreak
        {
            get
            {
                return this.Menu.MenuCSS.MenuBreak;
            }
            set
            {
                this.Menu.MenuCSS.MenuBreak = value;
            }
        }

        public override string CSSContainerRoot
        {
            get
            {
                return this.Menu.MenuCSS.MenuContainer;
            }
            set
            {
                this.Menu.MenuCSS.MenuContainer = value;
            }
        }

        public override string CSSContainerSub
        {
            get
            {
                return this.Menu.MenuCSS.SubMenu;
            }
            set
            {
                this.Menu.MenuCSS.SubMenu = value;
            }
        }

        public override string CSSControl
        {
            get
            {
                return this.Menu.MenuCSS.MenuBar;
            }
            set
            {
                this.Menu.MenuCSS.MenuBar = value;
            }
        }

        public override string CSSIcon
        {
            get
            {
                return this.Menu.MenuCSS.MenuIcon;
            }
            set
            {
                this.Menu.MenuCSS.MenuIcon = value;
            }
        }

        public override string CSSIndicateChildRoot
        {
            get
            {
                return this.Menu.MenuCSS.RootMenuArrow;
            }
            set
            {
                this.Menu.MenuCSS.RootMenuArrow = value;
            }
        }

        public override string CSSIndicateChildSub
        {
            get
            {
                return this.Menu.MenuCSS.MenuArrow;
            }
            set
            {
                this.Menu.MenuCSS.MenuArrow = value;
            }
        }

        public override string CSSLeftSeparator
        {
            get
            {
                return this.m_strCSSLeftSeparator;
            }
            set
            {
                this.m_strCSSLeftSeparator = value;
            }
        }

        public override string CSSLeftSeparatorBreadCrumb
        {
            get
            {
                return this.m_strCSSLeftSeparatorBreadCrumb;
            }
            set
            {
                this.m_strCSSLeftSeparatorBreadCrumb = value;
            }
        }

        public override string CSSLeftSeparatorSelection
        {
            get
            {
                return this.m_strCSSLeftSeparatorSelection;
            }
            set
            {
                this.m_strCSSLeftSeparatorSelection = value;
            }
        }

        public override string CSSNode
        {
            get
            {
                return this.Menu.MenuCSS.MenuItem;
            }
            set
            {
                this.Menu.MenuCSS.MenuItem = value;
            }
        }

        public override string CSSNodeHover
        {
            get
            {
                return this.Menu.MenuCSS.MenuItemSel;
            }
            set
            {
                this.Menu.MenuCSS.MenuItemSel = value;
            }
        }

        public override string CSSNodeHoverRoot
        {
            get
            {
                return this.m_strCSSNodeHoverRoot;
            }
            set
            {
                this.m_strCSSNodeHoverRoot = value;
            }
        }

        public override string CSSNodeHoverSub
        {
            get
            {
                return this.m_strCSSNodeHoverSub;
            }
            set
            {
                this.m_strCSSNodeHoverSub = value;
            }
        }

        public override string CSSNodeRoot
        {
            get
            {
                return this.m_strCSSNodeRoot;
            }
            set
            {
                this.m_strCSSNodeRoot = value;
            }
        }

        public override string CSSNodeSelectedRoot
        {
            get
            {
                return this.m_strNodeSelectedRoot;
            }
            set
            {
                this.m_strNodeSelectedRoot = value;
            }
        }

        public override string CSSNodeSelectedSub
        {
            get
            {
                return this.m_strNodeSelectedSub;
            }
            set
            {
                this.m_strNodeSelectedSub = value;
            }
        }

        public override string CSSRightSeparator
        {
            get
            {
                return this.m_strCSSRightSeparator;
            }
            set
            {
                this.m_strCSSRightSeparator = value;
            }
        }

        public override string CSSRightSeparatorBreadCrumb
        {
            get
            {
                return this.m_strCSSRightSeparatorBreadCrumb;
            }
            set
            {
                this.m_strCSSRightSeparatorBreadCrumb = value;
            }
        }

        public override string CSSRightSeparatorSelection
        {
            get
            {
                return this.m_strCSSRightSeparatorSelection;
            }
            set
            {
                this.m_strCSSRightSeparatorSelection = value;
            }
        }

        public override string CSSSeparator
        {
            get
            {
                return this.m_strCSSSeparator;
            }
            set
            {
                this.m_strCSSSeparator = value;
            }
        }

        public override double EffectsDuration
        {
            get
            {
                return this.Menu.MenuEffects.MenuTransitionLength;
            }
            set
            {
                this.Menu.MenuEffects.MenuTransitionLength = value;
            }
        }

        public override string EffectsShadowColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.ShadowColor);
            }
            set
            {
                this.Menu.ShadowColor = Color.FromName(value);
            }
        }

        public override string EffectsShadowDirection
        {
            get
            {
                return this.Menu.MenuEffects.ShadowDirection;
            }
            set
            {
                this.Menu.MenuEffects.ShadowDirection = value;
            }
        }

        public override int EffectsShadowStrength
        {
            get
            {
                return this.Menu.MenuEffects.ShadowStrength;
            }
            set
            {
                this.Menu.MenuEffects.ShadowStrength = value;
            }
        }

        public override string EffectsStyle
        {
            get
            {
                return this.Menu.MenuEffects.get_Style(true).ToString();
            }
            set
            {
                string text1 = this.Menu.MenuEffects.get_Style(true).ToString() + value;
            }
        }

        public override string EffectsTransition
        {
            get
            {
                return this.Menu.MenuEffects.MenuTransition;
            }
            set
            {
                this.Menu.MenuEffects.MenuTransition = value;
            }
        }

        public override string ForceCrawlerDisplay
        {
            get
            {
                return this.Menu.ForceFullMenuList.ToString();
            }
            set
            {
                this.Menu.ForceFullMenuList = Convert.ToBoolean(value);
            }
        }

        public override string ForceDownLevel
        {
            get
            {
                return this.Menu.ForceDownlevel.ToString();
            }
            set
            {
                this.Menu.ForceDownlevel = Convert.ToBoolean(value);
            }
        }

        public override string IndicateChildImageRoot
        {
            get
            {
                return this.Menu.RootArrowImage;
            }
            set
            {
                this.Menu.RootArrowImage = value;
            }
        }

        public override string IndicateChildImageSub
        {
            get
            {
                return this.Menu.ArrowImage;
            }
            set
            {
                this.Menu.ArrowImage = value;
            }
        }

        public override bool IndicateChildren
        {
            get
            {
                return this.m_blnIndicateChildren;
            }
            set
            {
                this.m_blnIndicateChildren = value;
            }
        }

        public SolpartMenu Menu
        {
            get
            {
                return this.m_objMenu;
            }
        }

        public override decimal MouseOutHideDelay
        {
            get
            {
                return new decimal(this.Menu.MenuEffects.MouseOutHideDelay);
            }
            set
            {
                this.Menu.MenuEffects.MouseOutHideDelay = Convert.ToInt32(value);
            }
        }

        public override DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverAction MouseOverAction
        {
            get
            {
                if (this.Menu.MenuEffects.MouseOverExpand)
                {
                    return DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverAction.Expand;
                }
                return DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverAction.None;
            }
            set
            {
                if (value == DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverAction.Expand)
                {
                    this.Menu.MenuEffects.MouseOverExpand = true;
                }
                else
                {
                    this.Menu.MenuEffects.MouseOverExpand = false;
                }
            }
        }

        public override DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverDisplay MouseOverDisplay
        {
            get
            {
                DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverDisplay MouseOverDisplay=NavigationProvider.HoverDisplay.Highlight;
                switch (this.Menu.MenuEffects.MouseOverDisplay)
                {
                    case MenuEffectsMouseOverDisplay.Outset:
                        return DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverDisplay.Outset;

                    case MenuEffectsMouseOverDisplay.Highlight:
                        return DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverDisplay.Highlight;

                    case MenuEffectsMouseOverDisplay.None:
                        return DotNetNuke.Modules.NavigationProvider.NavigationProvider.HoverDisplay.None;
                }
                return MouseOverDisplay;
            }
            set
            {
                switch (((int) value))
                {
                    case 0:
                        this.Menu.MenuEffects.MouseOverDisplay = MenuEffectsMouseOverDisplay.Highlight;
                        break;

                    case 1:
                        this.Menu.MenuEffects.MouseOverDisplay = MenuEffectsMouseOverDisplay.Outset;
                        break;

                    case 2:
                        this.Menu.MenuEffects.MouseOverDisplay = MenuEffectsMouseOverDisplay.None;
                        break;
                }
            }
        }

        public override Control NavigationControl
        {
            get
            {
                return this.Menu;
            }
        }

        public override string NodeLeftHTMLBreadCrumbRoot
        {
            get
            {
                return this.m_strNodeLeftHTMLBreadCrumbRoot;
            }
            set
            {
                this.m_strNodeLeftHTMLBreadCrumbRoot = value;
            }
        }

        public override string NodeLeftHTMLBreadCrumbSub
        {
            get
            {
                return this.m_strNodeLeftHTMLBreadCrumbSub;
            }
            set
            {
                this.m_strNodeLeftHTMLBreadCrumbSub = value;
            }
        }

        public override string NodeLeftHTMLRoot
        {
            get
            {
                return this.m_strNodeLeftHTMLRoot;
            }
            set
            {
                this.m_strNodeLeftHTMLRoot = value;
            }
        }

        public override string NodeLeftHTMLSub
        {
            get
            {
                return this.m_strNodeLeftHTMLSub;
            }
            set
            {
                this.m_strNodeLeftHTMLSub = value;
            }
        }

        public override string NodeRightHTMLBreadCrumbRoot
        {
            get
            {
                return this.m_strNodeRightHTMLBreadCrumbRoot;
            }
            set
            {
                this.m_strNodeRightHTMLBreadCrumbRoot = value;
            }
        }

        public override string NodeRightHTMLBreadCrumbSub
        {
            get
            {
                return this.m_strNodeRightHTMLBreadCrumbSub;
            }
            set
            {
                this.m_strNodeRightHTMLBreadCrumbSub = value;
            }
        }

        public override string NodeRightHTMLRoot
        {
            get
            {
                return this.m_strNodeRightHTMLRoot;
            }
            set
            {
                this.m_strNodeRightHTMLRoot = value;
            }
        }

        public override string NodeRightHTMLSub
        {
            get
            {
                return this.m_strNodeRightHTMLSub;
            }
            set
            {
                this.m_strNodeRightHTMLSub = value;
            }
        }

        public override string PathImage
        {
            get
            {
                return this.Menu.IconImagesPath;
            }
            set
            {
                this.Menu.IconImagesPath = value;
            }
        }

        public override string PathSystemImage
        {
            get
            {
                return this.Menu.SystemImagesPath;
            }
            set
            {
                this.Menu.SystemImagesPath = value;
            }
        }

        public override string PathSystemScript
        {
            get
            {
                return this.Menu.SystemScriptPath;
            }
            set
            {
                this.Menu.SystemScriptPath = value;
            }
        }

        public override string SeparatorHTML
        {
            get
            {
                return this.m_strSeparatorHTML;
            }
            set
            {
                this.m_strSeparatorHTML = value;
            }
        }

        public override string SeparatorLeftHTML
        {
            get
            {
                return this.m_strSeparatorLeftHTML;
            }
            set
            {
                this.m_strSeparatorLeftHTML = value;
            }
        }

        public override string SeparatorLeftHTMLActive
        {
            get
            {
                return this.m_strSeparatorLeftHTMLActive;
            }
            set
            {
                this.m_strSeparatorLeftHTMLActive = value;
            }
        }

        public override string SeparatorLeftHTMLBreadCrumb
        {
            get
            {
                return this.m_strSeparatorLeftHTMLBreadCrumb;
            }
            set
            {
                this.m_strSeparatorLeftHTMLBreadCrumb = value;
            }
        }

        public override string SeparatorRightHTML
        {
            get
            {
                return this.m_strSeparatorRightHTML;
            }
            set
            {
                this.m_strSeparatorRightHTML = value;
            }
        }

        public override string SeparatorRightHTMLActive
        {
            get
            {
                return this.m_strSeparatorRightHTMLActive;
            }
            set
            {
                this.m_strSeparatorRightHTMLActive = value;
            }
        }

        public override string SeparatorRightHTMLBreadCrumb
        {
            get
            {
                return this.m_strSeparatorRightHTMLBreadCrumb;
            }
            set
            {
                this.m_strSeparatorRightHTMLBreadCrumb = value;
            }
        }

        public override string StyleBackColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.BackColor);
            }
            set
            {
                this.Menu.BackColor = Color.FromName(value);
            }
        }

        public override decimal StyleBorderWidth
        {
            get
            {
                return new decimal(this.Menu.MenuBorderWidth);
            }
            set
            {
                this.Menu.MenuBorderWidth = Convert.ToInt32(value);
            }
        }

        public override decimal StyleControlHeight
        {
            get
            {
                return new decimal(this.Menu.MenuBarHeight);
            }
            set
            {
                this.Menu.MenuBarHeight = Convert.ToInt32(value);
            }
        }

        public override string StyleFontBold
        {
            get
            {
                return this.Menu.Font.Bold.ToString();
            }
            set
            {
                this.Menu.Font.Bold = Convert.ToBoolean(value);
            }
        }

        public override string StyleFontNames
        {
            get
            {
                return Strings.Join(this.Menu.Font.Names, ";");
            }
            set
            {
                this.Menu.Font.Names = value.Split(new char[] { ';' });
            }
        }

        public override decimal StyleFontSize
        {
            get
            {
                return new decimal(this.Menu.Font.Size.Unit.Value);
            }
            set
            {
                this.Menu.Font.Size = FontUnit.Parse(value.ToString());
            }
        }

        public override string StyleForeColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.ForeColor);
            }
            set
            {
                this.Menu.ForeColor = Color.FromName(value);
            }
        }

        public override string StyleHighlightColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.HighlightColor);
            }
            set
            {
                this.Menu.HighlightColor = Color.FromName(value);
            }
        }

        public override string StyleIconBackColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.IconBackgroundColor);
            }
            set
            {
                this.Menu.IconBackgroundColor = Color.FromName(value);
            }
        }

        public override decimal StyleIconWidth
        {
            get
            {
                return new decimal(this.Menu.IconWidth);
            }
            set
            {
                this.Menu.IconWidth = Convert.ToInt32(value);
            }
        }

        public override decimal StyleNodeHeight
        {
            get
            {
                return new decimal(this.Menu.MenuItemHeight);
            }
            set
            {
                this.Menu.MenuItemHeight = Convert.ToInt32(value);
            }
        }

        public override string StyleRoot
        {
            get
            {
                return this.m_strStyleRoot;
            }
            set
            {
                this.m_strStyleRoot = value;
            }
        }

        public override string StyleSelectionBorderColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.SelectedBorderColor);
            }
            set
            {
                if (value != null)
                {
                    this.Menu.SelectedBorderColor = Color.FromName(value);
                }
                else
                {
                    this.Menu.SelectedBorderColor = Color.Empty;
                }
            }
        }

        public override string StyleSelectionColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.SelectedColor);
            }
            set
            {
                this.Menu.SelectedColor = Color.FromName(value);
            }
        }

        public override string StyleSelectionForeColor
        {
            get
            {
                return ColorTranslator.ToHtml(this.Menu.SelectedForeColor);
            }
            set
            {
                this.Menu.SelectedForeColor = Color.FromName(value);
            }
        }

        public override bool SupportsPopulateOnDemand
        {
            get
            {
                return false;
            }
        }
    }
}

